package com.my.mybasefragment.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.my.mybasefragment.R;
import com.my.mybasefragment.activity.SimpleActivity;
import com.my.mybasefragment.base_fragment.BaseFragmentTransaction;

/**
 * 项目名称：MyBaseFragment
 * 创建人：mwb
 * 创建时间：2018/6/19 11:52
 */

public class FragmentTThree extends BaseFragmentTransaction implements View.OnClickListener {
    private TextView tvThree;

    @Override
    protected int setView() {
        return R.layout.fragment_three;
    }

    @Override
    protected void init(View view) {
        tvThree = view.findViewById(R.id.tv_three_fragment);
        tvThree.setOnClickListener(this);
    }

    @Override
    protected void initData(Bundle savedInstanceState) {

    }

    @Override
    protected void onCurrentResumeOk() {
        Log.i("bmw", "Fragment TThree onCurrentResumeOk");
    }

//    @Override
//    public void onHiddenChanged(boolean hidden) {
//        super.onHiddenChanged(hidden);
//        if (hidden) {
//            Log.i("bmw", "onHiddenChanged TThree if");
//        } else {
//            Log.i("bmw", "onHiddenChanged TThree else");
//        }
//    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_three_fragment:
                goIntent(SimpleActivity.class);
                break;
        }
    }

    private void goIntent(Class cla) {
        Intent intent = new Intent(getActivity(), cla);
        intent.putExtra("isWho", "TThree");
        startActivity(intent);
    }
}
